-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto encrypted publish when recps is set #212
Conversation
|
Benchmark results
|
db.js
Outdated
if (msg.recps) { | ||
msg = ssbKeys.box( | ||
msg, | ||
msg.recps.map((x) => x.substr(1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only supports classic encryption. A good start but we need an interface like add Boxer and addUnboxer right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I would rather do that in #90. Would like ssbc/ssb-fixtures#2 to be in a bit better shape before really looking at that again though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I was looking at that x.substr(1)
and got confused. Do we need to remove the sigil @
?
According to ssb-keys implementation, yes:
https://github.com/ssb-js/ssb-keys/blob/98569aa430e344b3ed144fcebf5d2755f7355bf6/index.js#L139
But according to how Patchwork does it right now, it checks if it's a Ref.isFeed()
:
How does Patchwork even work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that it also works that way I'm open to maybe doing this without the substr. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this substr here seems not necessary if ssb-keys does it in utils.toBuffer
Benchmark results
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Benchmark results
|
To fix #211. Current behaviour can be a bit of a gotcha when coming from db1. First commit is just a failing test.